import 'comment.dart'; // 导入 Comment 模型

class Post {
  final String postId;
  final String userId;
  final String title;
  final String content;
  final List<String> images;
  final String? videoUrl;
  int likesCount;  // 修改为非 final，以便可以设置
  int commentsCount; // 修改为非 final，以便可以更新
  final DateTime ctime;
  bool isLiked;
  bool isFollowed;
  final String userNickname;  // 添加用户昵称
  final String userAvatarUrl;  // 添加用户头像 URL
  List<Comment> comments; // 评论列表

  Post({
    required this.postId,
    required this.userId,
    required this.title,
    required this.content,
    required this.images,
    this.videoUrl,
    required this.likesCount,
    required this.commentsCount,
    required this.ctime,
    this.isLiked = false,
    this.isFollowed = false,
    required this.userNickname,  // 添加到构造函数
    required this.userAvatarUrl,  // 添加到构造函数
    this.comments = const [],  // 初始化为空列表
  });
}